<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>山东营销风云榜</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../css/part/mini.css">
    <link rel="stylesheet" href="../../../css/part/tabHead.css">
</head>

<body>

<div id="app">
    <div id="tableHead">
        <img src="../../../img/part/deptLevels/deptStandard.png" id="branchHead" align="center">
        <a href="../../portal/navigationYX.html"><img src="../../../img/portal/min.png" id="miniImg"></a>
        <table width="100%">
            <tr>
                <thead>
                <th width="15%">NO</th>
                <th width="25%">机构</th>
                <th width="20%">入围标准总监区数量</th>
                <th width="20%">入围标准营业部数量</th>
                <th width="20%">入围标准营业组数量</th>
                </thead>
            </tr>
        </table>
    </div>
    <div id="midDiv"></div>
    <div class="tableBody">
        <table id="tab" width="100%">
            <tbody id="tbody">
            </tbody>
        </table>
    </div>
</div>
</body>
<script src="../../../js/vue.js"></script>
<script src="../../../js/axios.js"></script>
<script src="../../../js/head.js"></script>
<script src="../../../js/jquery-3.2.1.min.js"></script>
<script src="../../../js/share.js"></script>

<script>
    window.onload = function () {
        new Vue({
            el: '#app',
            data() {
                return {
                    //中支名称
                    saleDeptsName: '',
                    //达标总监区数量
                    standardNumAS: 0,
                    //达标营业部数量
                    standardNumBM: 0,
                    //达标营业组数量
                    standardNumBC: 0,
                    pojo: {},
                    divHeight: 0,

                }
            },
            created() {
                this.getSaleDeptStandard();
            },
            methods: {

                //获取各中支的数据
                getSaleDeptStandard() {
                    document.getElementById("midDiv").style.height = window.getComputedStyle(document.getElementById("tableHead")).getPropertyValue("height");
                    setTimeout(() => {
                        axios.get(`/deptLevels/getSaleDeptStandard`).then(response => {
                            this.pojo = response.data;
                            var str = "";//定义用于拼接的字符串
                            for (var i = 0; i < this.pojo.length; i++) {
                                //拼接表格的行和列
                                str = "<tr><td width=\"15%\">" + (i + 1) + "</td>" +
                                    "<td width=\"25%\">" + this.pojo[i].saleDeptsName + "</td>" +
                                    "<td width=\"20%\">" + this.pojo[i].standardNumAS + "</td>" +
                                    "<td width=\"20%\">" + this.pojo[i].standardNumBM + "</td>" +
                                    "<td width=\"20%\">" + this.pojo[i].standardNumBC + "</td></tr>";
                                //追加到table中
                                $("#tbody").append(str);
                            }
                        })
                    }, 200)
                },

            }
        })
    }
</script>

</html>